package com.bjpowernode.spring6.service.impl;

import com.bjpowernode.spring6.dao.UserDao;
import com.bjpowernode.spring6.dao.impl.UserDaoImpl;
import com.bjpowernode.spring6.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class UserServiceImpl implements UserService {
    private final static Logger logger = LoggerFactory.getLogger(UserService.class);
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void deleteUser(Integer id) {
        int count = userDao.deleteById(id);
        System.out.printf("修改的id是%d.\n",count);
    }

    @Override
    public void insert() {
        logger.debug("UserServiceImpl 的insert方法执行");
        userDao.insert();
    }
}
